/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author kheirarahali
 */
@Entity
@Table(name = "Commentaire")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Commentaire.findAll", query = "SELECT c FROM Commentaire c"),
    @NamedQuery(name = "Commentaire.findByIdCommentaire", query = "SELECT c FROM Commentaire c WHERE c.idCommentaire = :idCommentaire"),
    @NamedQuery(name = "Commentaire.findByCommentaire", query = "SELECT c FROM Commentaire c WHERE c.commentaire = :commentaire"),
    @NamedQuery(name = "Commentaire.findByNote", query = "SELECT c FROM Commentaire c WHERE c.note = :note"),
    @NamedQuery(name = "Commentaire.findByProductidProduct", query = "SELECT c FROM Commentaire c WHERE c.productidProduct = :productidProduct")})
public class Commentaire implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idCommentaire")
    private Integer idCommentaire;
    @Column(name = "commentaire")
    private String commentaire;
    @Column(name = "note")
    private String note;
    @Column(name = "Product_idProduct")
    private Integer productidProduct;

    public Commentaire() {
    }

    public Commentaire(Integer idCommentaire) {
        this.idCommentaire = idCommentaire;
    }

    public Integer getIdCommentaire() {
        return idCommentaire;
    }

    public void setIdCommentaire(Integer idCommentaire) {
        this.idCommentaire = idCommentaire;
    }

    public String getCommentaire() {
        return commentaire;
    }

    public void setCommentaire(String commentaire) {
        this.commentaire = commentaire;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Integer getProductidProduct() {
        return productidProduct;
    }

    public void setProductidProduct(Integer productidProduct) {
        this.productidProduct = productidProduct;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCommentaire != null ? idCommentaire.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Commentaire)) {
            return false;
        }
        Commentaire other = (Commentaire) object;
        if ((this.idCommentaire == null && other.idCommentaire != null) || (this.idCommentaire != null && !this.idCommentaire.equals(other.idCommentaire))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Commentaire[ idCommentaire=" + idCommentaire + " ]";
    }
    
}
